package com.ruoyi.project.cms.type.service;

import com.ruoyi.common.utils.security.ShiroUtils;
import com.ruoyi.project.cms.type.domain.Type;
import com.ruoyi.project.cms.type.mapper.TypeEditMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class EditTypeServiceImpl implements IEditTypeService {
    @Autowired
    private TypeEditMapper typeEditMapper;
    @Override
    public Type selectTypeById(Long typeId) {

       Type type= typeEditMapper.selectTypeById(typeId);
        System.out.println(type);
        return type;
    }

    @Override
    public int updateType(Type type) {
        type.setUpdateBy(ShiroUtils.getLoginName());

        int i =typeEditMapper.updateType(type);
        return i;
    }
}
